package pt.ist.meic.pava;

import javassist.CtClass;

/**
 * 
 * @author Antonio Massingue
 * @author Joao Matos
 * @author Nuno Santos
 * 
 * This Exception should be thrown when the @AliasedTrait
 * annotation is used anywhere else but inside the @WithTraits 
 * annotation 
 * 
 */
public class BadUsageAliasedTraitException extends Exception {

	/**
	 * The Serial Version Id
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * The annotated Class
	 */
	private CtClass ctClass;
	
	
	
	
	

	/**
	 * Constructor Default
	 */
	public BadUsageAliasedTraitException() {
		super();
	}

	/**
	 * Constructor Overloaded
	 * @param aClass
	 */
	public BadUsageAliasedTraitException(CtClass aClass) {
		super();
		this.ctClass = aClass;
	}

	
	
	
	
	/**
	 * This method prints the detailed message of this exception
	 */
	public void printBadUsageAliasedTraitExceptionDetailedMessage() {
		
		System.err.println("The @AliasedTrait annotation is " +
				"wrongly used on the class "+
				this.ctClass.getName());
		
	}
	
	
	
	
	
	
	/**
	 * @return the annotated class
	 */
	public CtClass getCtClass() {
		return ctClass;
	}

	/**
	 * @param ctClass	The annotated class
	 */
	public void setCtClass(CtClass ctClass) {
		this.ctClass = ctClass;
	}

}
